package com.jwater.web.ui.tags;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ui.AbstractClosingTag;

import com.jwater.web.ui.tag.components.Pager;
import com.opensymphony.xwork2.util.ValueStack;

public class PagerTag extends AbstractClosingTag {

	private static final long serialVersionUID = -7207677399786175254L;
	
	protected String href;
	protected String displayNum;

	public void sethref(String href) {
		this.href = href;
	}
	
	public String getDisplayNum() {
		return displayNum;
	}

	public void setDisplayNum(String displayNum) {
		this.displayNum = displayNum;
	}
	
	@Override
	protected void populateParams() {
		// TODO Auto-generated method stub
		super.populateParams();
		
		Pager pager=((Pager)component);
		pager.setHref(href);
		pager.setDisplayNum(displayNum);
	}

	@Override
	public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
		return new Pager(stack, req, res);
	}

}
